using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using AloneLibrary.Particlesystem;

namespace Alone.Particlesystem {
    /// <summary>
    /// Custom particle system for creating a rocketbootsfire effect.
    /// </summary>
    public class RocketBootsFireParticleSystem : ParticleSystem {

        /// <summary>
        /// Initializes a new instance of the <see cref="RocketBootsFireParticleSystem"/> class.
        /// </summary>
        /// <param name="game"></param>
        /// <param name="content"></param>
        public RocketBootsFireParticleSystem(Game game, ContentManager content)
            : base(game, content) { }


        /// <summary>
        /// Derived particle system classes should override this method
        /// and use it to initalize their tweakable settings.
        /// </summary>
        /// <param name="settings"></param>
        protected override void InitializeSettings(ParticleSettings settings) {
            settings.TextureName = @"Textures\fire";

            settings.MaxParticles = 1200;

            settings.Duration = TimeSpan.FromSeconds(2);

            settings.DurationRandomness = 1;

            settings.MinHorizontalVelocity = 0;
            settings.MaxHorizontalVelocity = 15;

            settings.MinVerticalVelocity = -30;
            settings.MaxVerticalVelocity = 30;

            // Set gravity upside down, so the rocketbootsflames will 'fall' upward.
            settings.Gravity = new Vector3(0, 15, 0);

            settings.MinColor = new Color(255, 255, 255, 10);
            settings.MaxColor = new Color(255, 255, 255, 40);

            settings.MinStartSize = 10;
            settings.MaxStartSize = 20;

            settings.MinEndSize = 200;
            settings.MaxEndSize = 800;
        }
    }
}
